#include <QDebug>
#include "aboutdialog.h"

aboutDialog::aboutDialog(QWidget *parent) : QDialog(parent), state_ok(false) {
    setupUi(this);
    connect(aboutButton, SIGNAL(clicked()), qApp, SLOT(aboutQt()));
    connect(label, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(react(QPoint)));
}

void aboutDialog::keyPressEvent(QKeyEvent* event) {
    if(event->key() == Qt::Key_Meta) state_ok = true;
}

void aboutDialog::keyReleaseEvent(QKeyEvent* event) {
    if(event->key() == Qt::Key_Meta) state_ok = false;
}

void aboutDialog::react(QPoint)  {
    if(state_ok) plainTextEdit->setPlainText("Sveta Skvortsova is da best woman eva");
}

void aboutDialog::changeEvent(QEvent *e)
{
    QDialog::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        retranslateUi(this);
        break;
    default:
        break;
    }
}
